Fix chat input pushed off-screen on long conversations#58
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On long conversations (often citation-heavy answers, which tend to be longer), the chat message area grew past the viewport and pushed the
ChatInputbelow the fold — users couldn't see or reach the input box.Root cause
Classic flexbox
min-h-0trap. The flex chain from the fixed-height root (h-dvh overflow-hidden) down to the scroll container (flex-1 overflow-y-auto) had several intermediate flex items —<main>,<section>, and the messages div — with nomin-h-0. A flex item's defaultmin-height: autorefuses to shrink below its content's intrinsic size, so instead of the inneroverflow-y-autoengaging, the whole column expanded and shoved the input off-screen.Fix
min-h-0on<main>and<section>inchat-shell.tsxmin-h-0on the messages scroll container in bothapp/chat/page.tsxandapp/chat/[chatId]/page.tsxshrink-0on theChatInputform so it's always pinned and never compressed5-line change, no behavioral change beyond the scroll fix. Also fixes the CitationRail's own scroll (its
asidealready hadoverflow-y-autobut the un-constrained<main>defeated it).Test plan
npm run build🤖 Generated with Claude Code
Summary by cubic
Fixes the chat input being pushed off-screen in long conversations by correcting the flex layout. The message area now scrolls as intended, and the Sources rail scrolls independently.
min-h-0to<main>and<section>incomponents/chat-shell.tsx.min-h-0to the message containers inapp/chat/page.tsxandapp/chat/[chatId]/page.tsx.shrink-0to theChatInputform to keep it pinned.Written for commit d56dcba. Summary will update on new commits.